package com.develop.data.loan.repository;

import com.develop.data.loan.model.LoanInstallment;
import com.develop.data.loan.model.LoanContract;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
import org.springframework.stereotype.Repository;

import java.util.List;

@RepositoryRestResource(path="loanInstallment")
public interface LoanInstallmentRepository extends JpaRepository<LoanInstallment, String> {
    List<LoanInstallment> findAllByLoanContract(LoanContract loanContract);
    LoanInstallment findAllByLoanContractAndInstallmentTerm(LoanContract loanContract, int installmentTerm);


}
